package factory;

public class Factory {
	
	public static Object getShape(Class<?extends Shape> clazz) {
		Object obj=null;
		if(clazz!=null) {
			try {
				obj=Class.forName(clazz.getName()).newInstance();
				return obj;
			} catch (InstantiationException |
					 IllegalAccessException |
					 ClassNotFoundException e) {
				e.printStackTrace();
			}
		}
		return null;
	}
}
